getsockname

Discover getsockname, include the articles, news, trends, analysis and practical advice about getsockname on alibabacloud.com

Get the IP address getsockname gethostname

Both getsockname and gethostname can obtain IP addresses, but there are other IP addresses: Getsockname: gets the IP address related to a specific socket. Gethostname: obtains all IP addresses of the local machine.   Let's take a look at their

UNIX Network programming: GetSockName and Getpeername functions

These functions either return a local protocol address (GETSOCKNAME) that is associated with a socket, or return the address of a foreign protocol associated with a socket (getpeername). #include int getsockname (int sockfd,struct sockaddr*

GetSockName () and Getpeername ()

For server side:Bind with the port as a wildcard: for the server, bind (0,IP), after calling the bind function, you can call GetSockName to get the local port number of the serverWith the IP address as the wildcard address bind, only after accept

Basic function of socket

Basic operation of Socket: (1) socket () function: (2) Bind () function: (3) Listen (), connect () function; (4) The Accept () function; (5) The Send and receive functions in the socket: (6) The Close () function: (7) The socket function is called

UNIX Network API functions (1)

Go here: http://blog.chinaunix.net/uid/23208702/abstract/1.html 1. bytecode Functions # Include Uint16_t htons (uint16_t host16bitvalue ); Uint32_t htonl (uint32_t host32bitvalue ); Back: Network byte order value   Uint16_t ntohs (uint16_t

Code Analysis for connecting processes and ports under Win2K

Associating processes and ports is a very useful function. You can clearly know which programs are using which ports are helpful for trojan detection and removal. However, although we can use the task manager to browse the process list and use

Linux Network Programming socket (7): A process initiates multiple connections and functions such as gethostbyname

1. In the simplest client/server program, a client is a process and only one connection is initiated, you only need to modify it to allow a client to initiate multiple connections and then use only one connection to send data. First, let's get to

[UNIX Network Programming] basic TCP socket programming and unix Network Programming

[UNIX Network Programming] basic TCP socket programming and unix Network Programming The concurrent server described in this chapter is a single customer Process Model Implemented by fork. The following is the socket function of the basic TCP client/

How can I obtain the IP address of a specified interface in C?

How can I obtain the IP address of a specified interface in C? The description of winsocket is as follows: 5.1.6 getsockname ()Brief description:Obtain the local name of a set of interfaces. # Include ; Int Pascal far getsockname (socket S, struct

UNPV1 the Fourth chapter: Basic TCP set interface programming

1 socket functionIn order to perform network I/O, the first thing a process must do is call the socket function, specifying the desired type of communication protocol#include int socket (intintint protocol);//返回:若成功则为非负描述符,若出错则为-1Where family

Total Pages: 11 1 2 3 4 5 .... 11 Go to: Go

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.